﻿using GDM.Hogar.Entidades;
using GDM.Hogar.Managers.Contratos;
using GDM.Hogar.Repositorios.Contratos;
using System;
using System.Collections.Generic;

namespace GDM.Hogar.Managers
{
    public class VinculoManager : IVinculoManager
    {
        private readonly IVinculoRepositorio _vinculoRepositorio;

        public VinculoManager(IVinculoRepositorio vinculoRepositorio)
        {
            if (vinculoRepositorio == null)
            {
                throw new ArgumentNullException("vinculoRepositorio");
            }
            _vinculoRepositorio = vinculoRepositorio;
        }

        public IList<Vinculo> ObtenerVinculos()
        {
            return _vinculoRepositorio.ObtenerVinculos();
        }

        public Vinculo CrearVinculo(string nombre)
        {
            return _vinculoRepositorio.CrearVinculo(nombre);
        }

        public void ActivarVinculo(int vinculoId, bool activo)
        {
            _vinculoRepositorio.ActivarVinculo(vinculoId, activo);
        }

        public void ActualizarVinculo(Vinculo vinculo)
        {
            _vinculoRepositorio.ActualizarVinculo(vinculo);
        }
    }
}